package org.example.demo04.diy;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
//代表一个切面
@Aspect
public class AnnotationPointcut {

    //代表
    @Before("execution(* org.example.demo04.service.UsreServiceImpl.*(..))")
    public void before(){
        System.out.println("======执行前=======");
    }
    @After("execution(* org.example.demo04.service.UsreServiceImpl.*(..))")
    public void after(){
        System.out.println("======执行后=======");
    }

    @Around("execution(* org.example.demo04.service.UsreServiceImpl.*(..))")
    public void Baround(ProceedingJoinPoint jp) throws Throwable {
        System.out.println("====环绕前=====");

        Object proceed = jp.proceed();//执行方法

        System.out.println("====环绕后=====");
    }
}
